package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.GoodPurchase;
import com.itheima.pojo.GoodsPurchaseQueryParam;
import lombok.Data;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface GoodsPurchaseMapper {
    @Delete("delete from purchase where id = #{id}")
    void delete(Integer id);


    @Insert("insert into purchase(purchase_name, num, unit_price, stocking_time, vendor_id) VALUES " +
            "(#{purchaseName},#{num},#{unitPrice},#{stockingTime},#{vendorId})")
    void add(GoodPurchase goodPurchase);

    void update(GoodPurchase goodPurchase);

    Page<GoodPurchase> list(GoodsPurchaseQueryParam goodsPurchaseQueryParam);

    void deleteByIds(List<Integer> ids);
}
